import type { App } from 'vue'
import TurboTablePlus from './components/index.vue'
import TuIconHandle from './components/handle/IconHandle.vue'
import TuTextHandle from './components/handle/TextHandle.vue'
import type { TableInstance } from './types/TableType'

const components = [
  {
    label: 'TurboTablePlus',
    component: TurboTablePlus
  },
  {
    label: 'TuIconHandle',
    component: TuIconHandle
  },
  {
    label: 'TuTextHandle',
    component: TuTextHandle
  }
]

const install = (app: App): void => {
  components.forEach(item => {
    app.component(item.label, item.component)
  })
}

export type { TableInstance }

export default { install }